package com.tianfei.crowd.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *
 * SpringMVC 的配置类
 *
 * @author: Herz
 * @date: 2021/7/30 15:30
 */
@Configuration
public class CrowdWebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {

        // 浏览器访问地址
        String urlPath = "/auth/member/to/register/page";

        //目标视图名，拼串
        String viewName = "member-register";

        // 添加 view-controller
        registry.addViewController(urlPath).setViewName(viewName);
        registry.addViewController("/auth/member/to/login/page").setViewName("member-login");
        registry.addViewController("/auth/member/to/center/page").setViewName("member-center");
        registry.addViewController("/member/to/crowd/project/page").setViewName("member-crowd");
    }
}
